
#include "stdafx.h"
#include "ParamPosition.h"
#include "CommDefine.h"

#if defined(_BIDCONTROL_) || !defined(_WEBKIT_NEW)
CParamPointFlash::CParamPointFlash(bool bSimulate) :CWebParameter(bSimulate, POLICY::Key[POLICY::PointFlash])
{
}

static CParamPointFlash defaultFlash[] = {
	CParamPointFlash(false), CParamPointFlash(true)
};
CParamPointFlash& CParamPointFlash::defaultValue(bool bSimulate)
{
	intptr_t id = (bSimulate ? 1 : 0);
	if (!defaultFlash[id].m_initialized)
	{
		if (!bSimulate)
			defaultFlash[id].ReadSimulate();
		else
		{
			defaultFlash[id].m_point[PROPPoint_BidPriceInput0] = CPoint(687, 150);
			defaultFlash[id].m_point[PROPPoint_BidPriceInput1] = CPoint(687, 207);
			defaultFlash[id].m_point[PROPPoint_BidButton1] = CPoint(801, 207);
			defaultFlash[id].m_point[PROPPoint_BidPriceInput2] = CPoint(674, 248);
			defaultFlash[id].m_point[PROPPoint_BidButton2] = CPoint(798, 251);
			defaultFlash[id].m_point[PROPPoint_CheckCodeInput] = CPoint(739, 253);
			defaultFlash[id].m_point[PROPPoint_CheckCodeButton] = CPoint(553, 335);
			defaultFlash[id].m_point[PROPPoint_CheckCodeCancel] = CPoint(742, 334);
			defaultFlash[id].m_point[PROPPoint_QueryInput] = CPoint(655, 213);
			defaultFlash[id].m_point[PROPPoint_QueryButton] = CPoint(553, 319);
			defaultFlash[id].m_point[PROPPoint_QueryCancel] = CPoint(742, 318);
			defaultFlash[id].m_point[PROPPoint_InfoButton] = CPoint(661, 311);
			defaultFlash[id].m_point[PROPPoint_Mark] = CPoint(645, 450);
		}
		defaultFlash[id].m_initialized = true;
	}
	return defaultFlash[id];
}

void CParamPointFlash::readINI(const CINIOperater *oper)
{
	CParamPointFlash &def = CParamPointFlash::defaultValue(m_bSimulate);
	m_point[PROPPoint_BidPriceInput0] = oper->GetPoint(section, L"BidPriceInput0", def.m_point[PROPPoint_BidPriceInput0]);
	m_point[PROPPoint_BidPriceInput1] = oper->GetPoint(section, L"BidPriceInput1", def.m_point[PROPPoint_BidPriceInput1]);
	m_point[PROPPoint_BidButton1] = oper->GetPoint(section, L"BidButton1", def.m_point[PROPPoint_BidButton1]);
	m_point[PROPPoint_BidPriceInput2] = oper->GetPoint(section, L"BidPriceInput2", def.m_point[PROPPoint_BidPriceInput2]);
	m_point[PROPPoint_BidButton2] = oper->GetPoint(section, L"BidButton2", def.m_point[PROPPoint_BidButton2]);
	m_point[PROPPoint_CheckCodeInput] = oper->GetPoint(section, L"CheckCodeInput", def.m_point[PROPPoint_CheckCodeInput]);
	m_point[PROPPoint_CheckCodeButton] = oper->GetPoint(section, L"CheckCodeButton", def.m_point[PROPPoint_CheckCodeButton]);
	m_point[PROPPoint_CheckCodeCancel] = oper->GetPoint(section, L"CheckCodeCancel", def.m_point[PROPPoint_CheckCodeCancel]);
	m_point[PROPPoint_QueryInput] = oper->GetPoint(section, L"QueryInput", def.m_point[PROPPoint_QueryInput]);
	m_point[PROPPoint_QueryButton] = oper->GetPoint(section, L"QueryButton", def.m_point[PROPPoint_QueryButton]);
	m_point[PROPPoint_QueryCancel] = oper->GetPoint(section, L"QueryCancel", def.m_point[PROPPoint_QueryCancel]);
	m_point[PROPPoint_InfoButton] = oper->GetPoint(section, L"InfoButton", def.m_point[PROPPoint_InfoButton]);
	m_point[PROPPoint_Mark] = oper->GetPoint(section, L"Mark", def.m_point[PROPPoint_Mark]);
}

void CParamPointFlash::writeINI(CINIOperater *oper) const
{
	oper->WritePoint(section, L"BidPriceInput0", &m_point[PROPPoint_BidPriceInput0]);
	oper->WritePoint(section, L"BidPriceInput1", &m_point[PROPPoint_BidPriceInput1]);
	oper->WritePoint(section, L"BidButton1", &m_point[PROPPoint_BidButton1]);
	oper->WritePoint(section, L"BidPriceInput2", &m_point[PROPPoint_BidPriceInput2]);
	oper->WritePoint(section, L"BidButton2", &m_point[PROPPoint_BidButton2]);
	oper->WritePoint(section, L"CheckCodeInput", &m_point[PROPPoint_CheckCodeInput]);
	oper->WritePoint(section, L"CheckCodeButton", &m_point[PROPPoint_CheckCodeButton]);
	oper->WritePoint(section, L"CheckCodeCancel", &m_point[PROPPoint_CheckCodeCancel]);
	oper->WritePoint(section, L"QueryInput", &m_point[PROPPoint_QueryInput]);
	oper->WritePoint(section, L"QueryButton", &m_point[PROPPoint_QueryButton]);
	oper->WritePoint(section, L"QueryCancel", &m_point[PROPPoint_QueryCancel]);
	oper->WritePoint(section, L"InfoButton", &m_point[PROPPoint_InfoButton]);
	oper->WritePoint(section, L"Mark", &m_point[PROPPoint_Mark]);
}
#endif	//!_WEBKIT_NEW

#if defined(_BIDCONTROL_) || defined(_WEBKIT_NEW)
CParamPointH5::CParamPointH5(bool bSimulate) :CWebParameter(bSimulate, POLICY::Key[POLICY::PointH5])
{
}

static CParamPointH5 defaultH5[] = {
	CParamPointH5(false), CParamPointH5(true)
};
CParamPointH5& CParamPointH5::defaultValue(bool bSimulate)
{
	intptr_t id = (bSimulate ? 1 : 0);
	if (!defaultH5[id].m_initialized)
	{
		if (!bSimulate)
			defaultH5[id].ReadSimulate();
		else
		{
			defaultH5[id].m_point[PROPPoint_BidPriceInput0] = CPoint(760, 405);
			defaultH5[id].m_point[PROPPoint_BidPriceInput1] = CPoint(760, 515);
			defaultH5[id].m_point[PROPPoint_BidButton1] = CPoint(1015, 515);
			defaultH5[id].m_point[PROPPoint_BidPriceInput2] = CPoint(860, 525);
			defaultH5[id].m_point[PROPPoint_BidButton2] = CPoint(1010, 525);
			defaultH5[id].m_point[PROPPoint_CheckCodeInput] = CPoint(960, 570);
			defaultH5[id].m_point[PROPPoint_CheckCodeButton] = CPoint(760, 680);
			defaultH5[id].m_point[PROPPoint_CheckCodeCancel] = CPoint(960, 680);
			defaultH5[id].m_point[PROPPoint_QueryInput] = CPoint(860, 530);
			defaultH5[id].m_point[PROPPoint_QueryButton] = CPoint(860, 610);
			defaultH5[id].m_point[PROPPoint_QueryCancel] = CPoint(860, 610);
			defaultH5[id].m_point[PROPPoint_InfoButton] = CPoint(860, 660);
			defaultH5[id].m_point[PROPPoint_Mark] = CPoint(810, 860);
		}
		defaultH5[id].m_initialized = true;
	}
	return defaultH5[id];
}

void CParamPointH5::readINI(const CINIOperater *oper)
{
	CParamPointH5 &def = CParamPointH5::defaultValue(m_bSimulate);
	m_point[PROPPoint_BidPriceInput0] = oper->GetPoint(section, L"BidPriceInput0", def.m_point[PROPPoint_BidPriceInput0]);
	m_point[PROPPoint_BidPriceInput1] = oper->GetPoint(section, L"BidPriceInput1", def.m_point[PROPPoint_BidPriceInput1]);
	m_point[PROPPoint_BidButton1] = oper->GetPoint(section, L"BidButton1", def.m_point[PROPPoint_BidButton1]);
	m_point[PROPPoint_BidPriceInput2] = oper->GetPoint(section, L"BidPriceInput2", def.m_point[PROPPoint_BidPriceInput2]);
	m_point[PROPPoint_BidButton2] = oper->GetPoint(section, L"BidButton2", def.m_point[PROPPoint_BidButton2]);
	m_point[PROPPoint_CheckCodeInput] = oper->GetPoint(section, L"CheckCodeInput", def.m_point[PROPPoint_CheckCodeInput]);
	m_point[PROPPoint_CheckCodeButton] = oper->GetPoint(section, L"CheckCodeButton", def.m_point[PROPPoint_CheckCodeButton]);
	m_point[PROPPoint_CheckCodeCancel] = oper->GetPoint(section, L"CheckCodeCancel", def.m_point[PROPPoint_CheckCodeCancel]);
	m_point[PROPPoint_QueryInput] = oper->GetPoint(section, L"QueryInput", def.m_point[PROPPoint_QueryInput]);
	m_point[PROPPoint_QueryButton] = oper->GetPoint(section, L"QueryButton", def.m_point[PROPPoint_QueryButton]);
	m_point[PROPPoint_QueryCancel] = oper->GetPoint(section, L"QueryCancel", def.m_point[PROPPoint_QueryCancel]);
	m_point[PROPPoint_InfoButton] = oper->GetPoint(section, L"InfoButton", def.m_point[PROPPoint_InfoButton]);
	m_point[PROPPoint_Mark] = oper->GetPoint(section, L"Mark", def.m_point[PROPPoint_Mark]);
}

void CParamPointH5::writeINI(CINIOperater *oper) const
{
	oper->WritePoint(section, L"BidPriceInput0", &m_point[PROPPoint_BidPriceInput0]);
	oper->WritePoint(section, L"BidPriceInput1", &m_point[PROPPoint_BidPriceInput1]);
	oper->WritePoint(section, L"BidButton1", &m_point[PROPPoint_BidButton1]);
	oper->WritePoint(section, L"BidPriceInput2", &m_point[PROPPoint_BidPriceInput2]);
	oper->WritePoint(section, L"BidButton2", &m_point[PROPPoint_BidButton2]);
	oper->WritePoint(section, L"CheckCodeInput", &m_point[PROPPoint_CheckCodeInput]);
	oper->WritePoint(section, L"CheckCodeButton", &m_point[PROPPoint_CheckCodeButton]);
	oper->WritePoint(section, L"CheckCodeCancel", &m_point[PROPPoint_CheckCodeCancel]);
	oper->WritePoint(section, L"QueryInput", &m_point[PROPPoint_QueryInput]);
	oper->WritePoint(section, L"QueryButton", &m_point[PROPPoint_QueryButton]);
	oper->WritePoint(section, L"QueryCancel", &m_point[PROPPoint_QueryCancel]);
	oper->WritePoint(section, L"InfoButton", &m_point[PROPPoint_InfoButton]);
	oper->WritePoint(section, L"Mark", &m_point[PROPPoint_Mark]);
}
#endif	//_WEBKIT_NEW
